<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .box {
            width: 100vw;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .header {
            height: 100px;
            background: pink;
        }

        .main {
            flex: 1;
            display: flex;
        }

        .footer {
            height: 150px;
            background: purple;
        }

        .left {
            width: 150px;
            background: teal;
        }

        .right {
            flex: 1;
        }
    </style>
</head>

<body>
    <!-- 定义挂载点 -->
    <div id="app"></div>


    <template id="ap">
        <div class="box">
            <v-header></v-header>
            <v-main></v-main>
            <v-footer></v-footer>
        </div>
    </template>


    <template id="header">
        <div class="header">
            <h1>header</h1>
        </div>
    </template>
    <template id="main">
        <div class="main">
            <v-left></v-left>
            <v-right></v-right>
        </div>
    </template>
    <template id="footer">
        <div class="footer">
            <h1>footer</h1>
        </div>
    </template>

    <template id="left">
        <div class="left">
            <h1>left</h1>
        </div>
    </template>

    <template id="right">
        <div class="right">
            <h1>right</h1>
        </div>
    </template>

    <script>
        let vFooter = {
            template: "#footer"
        }
        let vRight = {
            template: "#right"
        }
        let vLeft = {
            template: "#left"
        }
        let vMain = {
            template: "#main",
            components: {
                vLeft,
                vRight,
            }
        }

        let vHeader = {
            template: "#header"
        }
        let App = {
            template: "#ap",
            components: {
                vHeader,
                vMain,
                vFooter
            }
        }



        new Vue({
            //挂载点
            // el: "#app",
            // template:"<v-app></v-app>",
            // components: {
            //     vApp,
            // }
            render:(h)=> h(App)
            
        }).$mount("#app")
    </script>
</body>

</html>

